package ee.sepp.aui.ui.views.header;

import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Button.ClickEvent;

@SuppressWarnings("serial")
public class AuiHeader extends Panel {
	public AuiHeader() {
		super("Header");
		Button logout = new Button("Logout", new Button.ClickListener() {
			@Override
			public void buttonClick(ClickEvent event) {
				getUI().getNavigator().navigateTo("");
			}
		});
		
		VerticalLayout headerContent = new VerticalLayout();
		headerContent.setSizeFull();
		headerContent.setMargin(true);
		headerContent.addComponent(logout);
		headerContent.setComponentAlignment(logout, Alignment.TOP_RIGHT);
		setContent(headerContent);
	}
}
